package com.hgd.igreencar.biz.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hgd.igreencar.biz.IQuestionJutiPlusBiz;
import com.hgd.igreencar.dao.QuestionJutiPlusMapper;
import com.hgd.igreencar.entity.QuestionJutiPlus;
import com.hgd.igreencar.entity.VehicleExhaustPlus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionJutiPlusBizImpl implements IQuestionJutiPlusBiz {
    @Autowired
    private QuestionJutiPlusMapper questionJutiPlusMapper;

    /**
     * 查询故障车辆信息
     */
    @Override
    public PageInfo queryFault(String areaName, String brandName, String questionReasion, int currentPage, int pageSize) {
        PageHelper.startPage(currentPage,pageSize);
        PageInfo pageInfo = new PageInfo(questionJutiPlusMapper.queryFault(areaName, brandName, questionReasion,currentPage,pageSize));
        return pageInfo;
    }
    /**
     * 按ID查询故障车辆
     */
    @Override
    public PageInfo queryByIdFault(Integer carId, int currentPage, int pageSize) {
        PageHelper.startPage(currentPage,pageSize);
        PageInfo pageInfo = new PageInfo(questionJutiPlusMapper.queryByIdFault(carId,currentPage,pageSize));
        return pageInfo;
    }

    @Override
    public PageInfo<QuestionJutiPlus> queryAllFault(int currentPage, int pageSize) {
        PageHelper.startPage(currentPage,pageSize);
        PageInfo pageInfo = new PageInfo(questionJutiPlusMapper.queryAllFault(currentPage,pageSize));
        return pageInfo;
    }

    @Override
    public PageInfo<QuestionJutiPlus> queryFaultByJson(String areaName, String brandName, String questionReasion, int currentPage, int pageSize) {
        PageHelper.startPage(currentPage,pageSize);
        PageInfo pageInfo = new PageInfo(questionJutiPlusMapper.queryFaultByJson(areaName, brandName, questionReasion,currentPage,pageSize));
        return pageInfo;
    }

}
